﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace KPD_Admin
{
    public partial class Employees : Form
    {
        public Employees()
        {
            InitializeComponent();
        }

        private void Employees_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'dataSet1.JOBS' table. You can move, or remove it, as needed.
            this.jOBSTableAdapter.Fill(this.dataSet1.JOBS);
            // TODO: This line of code loads data into the 'dataSet1.EMPLOYEES' table. You can move, or remove it, as needed.
            this.eMPLOYEESTableAdapter.Fill(this.dataSet1.EMPLOYEES);
            this.Width=System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width;
            dataGridView1.Width = this.Width;
            dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
        }

        private void AddButton_Click(object sender, EventArgs e)
        {
            AddEmpForm addfrm = new AddEmpForm();
            addfrm.Show();
        }

        private void PerButton_Click(object sender, EventArgs e)
        {
            int index = dataGridView1.SelectedCells[0].OwningRow.Index;
            string id = dataSet1.EMPLOYEES[index][0].ToString();
            PerfomanceForm perform = new PerfomanceForm(id);
            perform.Show();

        }

        private void editButton_Click(object sender, EventArgs e)
        {
            //int index = dataGridView1.SelectedCells[0].OwningRow.Index;
           
            string id = dataSet1.EMPLOYEES[dataGridView1.SelectedCells[0].OwningRow.Index][0].ToString();
            AddEmpForm editform = new AddEmpForm(id);
            editform.Show();
            
        }
    }
}
